package dcc.service;

import dcc.model.SocialScienceInfo;
import dcc.persistence.SocialScienceMapper;

public class SocialScienceService extends BaseService {

	private SocialScienceMapper socialScienceMapper;

	public void setSocialScienceMapper(SocialScienceMapper socialScienceMapper) {
		this.socialScienceMapper = socialScienceMapper;
	}

	public SocialScienceService() {
		super(SocialScienceService.class);
	}

	public void save(SocialScienceInfo socialScienceInfo) {
		if (socialScienceInfo.getId() == 0) {
			insert(socialScienceInfo);
		} else {
			update(socialScienceInfo);
		}
	}

	private void insert(SocialScienceInfo socialScienceInfo) {
		socialScienceMapper.insert(socialScienceInfo);
	}

	private void update(SocialScienceInfo socialScienceInfo) {
		socialScienceMapper.update(socialScienceInfo);
	}

	public SocialScienceInfo getSocialScienceInfoByBaseId(int baseId) {
		return socialScienceMapper.getSocialScienceInfoByBaseId(baseId);
	}

}
